const MyPromise = require('./code4')

const p = new MyPromise((resolve, reject) => {
  setTimeout(() => {
    resolve('ch')
  }, 1000)
})

const p2 = p.then().then(value => {
  console.log('value2', value)
})

const p3 = new MyPromise((resolve, reject) => {
  resolve('p3')
})

MyPromise.all(['a', 'b', p, p2, p3]).then(arr => {
  console.log(arr)
})
